跟數位邏輯的判斷一樣有and、or、not
and若為True需兩者皆為True,or只需其一為True就為True,若原本為True前面+not則反轉變為False
if條件式:
若身上money只有$50
if money<=70:
print('錢不夠')
則會印出print這行
基礎架構
C:
#include
int main()
{
printf(“Hello! World!\n”);
}
若A=2
(a > 1) and (a < 5) #True and True ->True
(a > 1) and (a > 5) #True and False ->False
(a > 1) and (a > 5) #True and False ->True